import axios from 'axios'

//请求相关 
const http = {

};
// http.userLogin=function(params){
//     return axios.post('/api/login',params).then(r=>r.data)

// }
axios.interceptors.request.use(function (config) {
    // Do something before request is sent
    //window.localStorage.getItem("accessToken") 获取token的value
    let token = window.sessionStorage.getItem("userToken")
    if (token) {
        //将token放到请求头发送给服务器,将tokenkey放在请求头中
        config.headers.userToken = token;
        //也可以这种写法
        // config.headers['accessToken'] = Token;
    }
    return config;
}, function (error) {
    // Do something with request error
    return Promise.reject(error);
});
// f登录
http.userLogin = params => axios.post("/api/buildAdmin/login", params).then(r => r.data)
http.userAdd = params => axios.post("/api/buildPeople/addPeople", params).then(r => r.data)
//人员管理input框
http.input1 = params => axios.post("/api/buildCompany/getCompanyList", params).then(r => r.data)
http.input2 = params => axios.post("/api/buildJob/getBuildJobList", params).then(r => r.data)
// 人员管理查询
http.search = params => axios.post("/api/buildPeople/likeBuildPeopleList", params).then(r => r.data)
//单独删除表格
http.shanchu = params => axios.post("/api/buildPeople/delBuildPeople", params).then(r => r.data)
// 人员管理表格
 http.rygl = params => axios.post("/api/buildPeople/likeBuildPeopleList", params).then(r => r.data)
 // 人员管理编辑工作经历表格的删除
 http.ldelBuildExperience = params => axios.post("/api/buildExperience/delBuildExperience", params).then(r => r.data)
 //人员管理编辑
http.rygledit = params => axios.post("/api/buildPeople/updPeopleInfo", params).then(r => r.data)
//人员管理项目班组表格
http.ryglxmbz1 = params => axios.post("/api/buildGroup/getBuildGroupList", params).then(r => r.data)
// 项目班组新增
http.ryglxmbz2 = params => axios.post("/api/buildGroup/addBuildGroup", params).then(r => r.data)
//项目班组编辑保存
// buildGroup/updBuildGroup
http.ryglxmbz3edit = params => axios.post("/api/buildGroup/updBuildGroup", params).then(r => r.data)
//项目班组编辑的人员管理
http.ryglxmbzRen = params => axios.post("/api/buildPeople/likeBuildPeopleList", params).then(r => r.data)
//项目班组编辑的人员管理的删除
http.ryglxmbzdel = params => axios.post("/api/buildGroup/updBuildGroupPeople", params).then(r => r.data)
// 考勤页面设备名称下拉框
http.getEquipmentName = params => axios.post("/api/buildEquipment/getEquipmentName", params).then(r => r.data)
// 上传图片

http.load = params => axios.post("/api/pic/load", params).then(r => r.data)
//项目班组搜索
http.xmbzsearch = params => axios.post("/api/buildCompany/getCompanyList", params).then(r => r.data)
//项目班组删除
http.xmbzshanchu = params => axios.post("/api/buildGroup/delGroupList", params).then(r => r.data)
// 劳动力编辑提交
http.updBuildPlanPeople = params => axios.post("/api/buildPlanPeople/updBuildPlanPeople", params).then(r => r.data)
// // 人员管理表格
// http.rygl = params => axios.post("/api/buildPeople/getBuildPeopleList", params).then(r => r.data)
// f劳动力班组搜索框
http.getGroupName = params => axios.post("/api/buildGroup/getGroupName", params).then(r => r.data)
// 劳动力搜索提交按钮
http.getBuildPlanList = params => axios.post("/api/buildPlan/getBuildPlanList", params).then(r => r.data)
// 劳务新增
http.getInsertGroupName = params => axios.post("/api/buildPlan/getInsertGroupName", params).then(r => r.data)
// 劳动力删除l
http.ldelBuildPlan = params => axios.post("/api/buildPlan/delBuildPlan", params).then(r => r.data)

//劳动力跳转页面提交按钮
http.addBuildPlan = params => axios.post("/api/buildPlan/addBuildPlan", params).then(r => r.data)
// f后台管理
// http.rygl = params => axios.post("/api/buildPeople/likeBuildPeopleList", params).then(r => r.data)
// 后台管理
http.userAdmin = params => axios.post("/api/buildAdmin/getBuildAdmins", params).then(r => r.data)
// f后台管理搜索
http.userSearch = params => axios.post("/api/buildAdmin/getBuildAdmins", params).then(r => r.data)
// f后台新增搜索
http.AddSearch = params => axios.post("/api/buildAdmin/getNoBuildAdmins", params).then(r => r.data)
// f后台编辑
http.FEdit = params => axios.post("/api/buildAdmin/updBuildAdmin", params).then(r => r.data)
// f后台新增下一步
http.Nextstep = params => axios.post("/api/buildAdmin/addBuildAdmin", params).then(r => r.data)
//  finput框条件判断用户名是否重复
http.RepeatName = params => axios.post("/api/buildAdmin/getAdminAccount", params).then(r => r.data)
// f后台管理者删除
http.DelUser = params => axios.post("/api/buildAdmin/delBuildAdmin", params).then(r => r.data)
// f后台role下拉框
http.bottomInput = params => axios.post("/api/buildRole/getBuildRoles", params).then(r => r.data)
// f角色管理删除
http.delBuildRole = params => axios.post("/api/buildRole/delBuildRole", params).then(r => r.data)
// 角色管理增加
http.addBuildRole = params => axios.post("/api/buildRole/addBuildRole", params).then(r => r.data)
// http.rygl = params => axios.post("/api/buildPeople/likeBuildPeopleList", params).then(r => r.data)
// 角色管理修改
http.updBuildRole = params => axios.post("/api/buildRole/updBuildRole", params).then(r => r.data)
// 角色权限
http.findBuildJurisdictions = params => axios.post("/api/buildJurisdictionRole/findBuildJurisdictions", params).then(r => r.data)

// f权限下拉框
http.updBuildJurisdictions = params => axios.post("/api/buildJurisdictionRole/updBuildJurisdictions", params).then(r => r.data)
// f查看权限
http.getBuildJurisdictions = params => axios.post("/api/buildJurisdiction/getBuildJurisdictions", params).then(r => r.data)
// f 人员考勤
http.getBuildAttendanceList = params => axios.post("/api/buildAttendance/getBuildAttendanceList", params).then(r => r.data)

// f证件到
http.getMaterialEndList = params => axios.post("/api/buildPeopleMaterial/getMaterialEndList", params).then(r => r.data)
//人员管理编辑
// f 上传
http.load = params => axios.post("/api/pic/load", params).then(r => r.data)
// f-控制台考勤  buildConsole/getAttendanceCount
http.getAttendanceCount = params => axios.post("/api/buildConsole/getAttendanceCount", params).then(r => r.data)
// f控制台 统计数据
http.getNum = params => axios.post("/api/buildConsole/getNum", params).then(r => r.data)
// 控制台
http.getPeopleIn = params => axios.post("/api/buildConsole/getPeopleIn", params).then(r => r.data)
// 控制台门禁表格
http.getAttendanceNum = params => axios.post("/api/buildConsole/getAttendanceNum ", params).then(r => r.data)
http.rygledit = params => axios.post("/api/buildPeople/updPeopleInfo", params).then(r => r.data)
//人员管理编辑中的工作经历表格的新增
http.rygledittableadd = params => axios.post("/api/buildExperience/updBuildExperience", params).then(r => r.data)


//人员管理项目班组表格
http.ryglxmbz1 = params => axios.post("/api/buildGroup/getBuildGroupList", params).then(r => r.data)
http.ryglxmbz2 = params => axios.post("/api/buildGroup/addBuildGroup", params).then(r => r.data)

//  http.ryglxmbz3 = params => axios.post("/api/buildGroup/updBuildGroupPeople", params).then(r => r.data)
// 人员管理培训表格
http.ryglpeitable = params => axios.post("/api/buildTrain/getBuildTrainList", params).then(r => r.data)
// 人员管理培训公司名称
http.ryglpeiinput1 = params => axios.post("/api/buildCompany/getCompanyList", params).then(r => r.data)
// 人员管理培训培训种类
http.ryglpeiinput2 = params => axios.post("/api/buildTrainType/getBuildTrainTypeList", params).then(r => r.data)
// 人员管理培训培训等级
http.ryglpeiinput3 = params => axios.post("/api/buildTrainLevel/getBuildTrainLevelList", params).then(r => r.data)
// 人员管理培训培训人员里模态框左边表格
http.ryglpeidiologleft = params => axios.post("/api/buildTrainManage/getTrainPeopleList", params).then(r => r.data)
// 人员管理培训表格新增
http.ryglpeitableadd = params => axios.post("/api/buildTrain/addBuildTrain", params).then(r => r.data)
// 人员管理培训编辑的表格
http.ryglpeitableedit = params => axios.post("/api/buildTrainManage/getBuildTrainManageList", params).then(r => r.data)
// 人员管理培训编辑提交按钮
http.ryglpeiedit = params => axios.post("/api/buildTrain/updBuildTrain", params).then(r => r.data)
// 个人中心
http.getBuildPeople = params => axios.post("/api/buildAdmin/getBuildPeople", params).then(r => r.data)
// 个人中心2
http.getBuildAdmin = params => axios.post("/api/buildAdmin/getBuildAdmin", params).then(r => r.data)




// 机械设备
// 搜索
http.system = params => axios.post("/api/buildEquipment/sel", params).then(r => r.data)
// 删除
http.del = params => axios.post("/api/buildEquipment/del", params).then(r => r.data)
// 添加
http.add = params => axios.post("/api/buildEquipment/in", params).then(r => r.data)
// 编辑
http.compile = params => axios.post("/api/buildEquipment/up", params).then(r => r.data)
// 双表添加
http.douadd = params => axios.post("/api/buildAllAdd/inWeather", params).then(r => r.data)//环境 
http.Newtower = params => axios.post("/api/buildAllAdd/inTower ", params).then(r => r.data)//塔吊
http.Newtrench = params => axios.post("/api/buildAllAdd/inPit", params).then(r => r.data)//基坑
http.Newelectric = params => axios.post("/api/buildAllAdd/inPower", params).then(r => r.data)//电力



// 项目档案新增input
http.danganaddinput = params => axios.post("/api/buildFileType/getBuildFileTypeList", params).then(r => r.data)//项目档案
// 项目档案新增确定
http.danganaddsure = params => axios.post("/api/buildFile/addBuildFile", params).then(r => r.data)//项目档案
// 项目档案表格
http.dangantable = params => axios.post("/api/buildFile/getBuildFiles", params).then(r => r.data)//项目档案
// 项目档案表格编辑
http.dangantabledit = params => axios.post("/api/buildFile/updBuildFile", params).then(r => r.data)//项目档案
// 项目档案表格删除
http.dangantabldel = params => axios.post("/api/buildFile/delBuildFile", params).then(r => r.data)//项目档案
//添加
http.project = params => axios.post("/api/buildFileType/getBuildFileTypes", params).then(r => r.data)//项目档案
// 编辑

http.danganedit = params => axios.post("/api/buildFileType/updBuildFileType", params).then(r => r.data)//项目档案
//删除
http.delete = params => axios.post("/api/buildFileType/delBuildFileType", params).then(r => r.data)//项目档案
//新建档安包
http.newconstruction = params => axios.post("/api/buildFileType/addBuildFileType", params).then(r => r.data)//项目档案
// 信息页面添加
http.addxi = params => axios.post("/api/buildInfo/getBuildInfo", params).then(r => r.data)//项目档案
// f项目信息
http.getBuildMaterials = params => axios.post("/api/buildMaterial/getBuildMaterials", params).then(r => r.data)
// 退出登录
// 删除
http.delBuildMaterial = params => axios.post("/api/buildMaterial/delBuildMaterial", params).then(r => r.data)//项目档案
//塔吊9
http.TaDiao = params => axios.post("/api/buildTower/sel", params).then(r => r.data)
//塔吊风速
http.TaDiaoweater = params => axios.post("/api/suiji/weather", params).then(r => r.data)
// 塔吊left
http.TaDiaoleft = params => axios.post("/api/buildEquipment/sel", params).then(r => r.data)//项目档案
//塔吊表格
http.TaDiaobiao = params => axios.post("/api/buildAlarminfo/sel", params).then(r => r.data)
//塔吊表1
http.TaDiaobiao1 = params => axios.post("/api/chaiFen/Tower", params).then(r => r.data)
//塔吊表2
http.TaDiaobiao2 = params => axios.post("/api/chaiFen/TowerYuan", params).then(r => r.data)
//环境10
http.huanjing1 = params => axios.post("/api/suiji/weather", params).then(r => r.data)
// 环境图
http.huanjing1chart = params => axios.post("/api/chaiFen/Weather", params).then(r => r.data)
// 环境表格
http.Huanjingbiao = params => axios.post("/api/buildAlarminfo/sel", params).then(r => r.data)
// 环境表格
http.Huanjingbiao2 = params => axios.post("/api/chaiFen/WeatherYuan", params).then(r => r.data)

http.loginOut = params => axios.post("/api/buildAdmin/loginOut", params).then(r => r.data)



//现场车辆
// 车辆监控系统

// ===车辆监控系统===
//查询
http.lineage  = params => axios.post("/api/buildCarinfo/sel", params).then(r => r.data)//车辆信息

//车辆信息弹框编辑
http.carcompile = params => axios.post("/api/buildCarinfo/up", params).then(r => r.data)//车辆信息
// //车辆信息 单位下拉 
http.clinput2 = params => axios.post("/api/buildCompany/getCompanyList", params).then(r => r.data)
//车辆信息表格里删除
http.cardel = params => axios.post("/api/buildCarinfo/del", params).then(r => r.data)//车辆信息




// 项目信息的添加
http.addBuildMaterial = params => axios.post("/api/buildMaterial/addBuildMaterial", params).then(r => r.data)
http.clinput1  = params => axios.post("/api/buildCompany/getCompanyList", params).then(r => r.data)
// ====项目信息的添加===
http.addBuildMaterial  = params => axios.post("/api/buildMaterial/addBuildMaterial", params).then(r => r.data)
// 项目信息的编辑
http.updBuildInfo = params => axios.post("/api/buildInfo/updBuildInfo", params).then(r => r.data)

// 参建单位
http.getCompanyList = params => axios.post("/api/buildCompany/getCompanyList", params).then(r => r.data)
// 参建单位新增
http.addBuildCompany = params => axios.post("/api/buildCompany/addBuildCompany", params).then(r => r.data)
// 参建单位下拉框  
http.getBuildCompanyTypes = params => axios.post("/api/buildCompanyType/getBuildCompanyTypes", params).then(r => r.data)
// 参建单位表格删除  buildCompany/delBuildCompany
http.delBuildCompany = params => axios.post("/api/buildCompany/delBuildCompany", params).then(r => r.data)

// 任务信息管理
// 消息管理添加
http.addmessage = params => axios.post("/api/buildMessage/in", params).then(r => r.data)
// 消息信息的修改  buildCompany/updBuildCompany
http.updBuildCompany = params => axios.post("/api/buildCompany/updBuildCompany", params).then(r => r.data)
// 消息节点  buildNode/getBuildNodes
http.getBuildNodes = params => axios.post("/api/buildNode/getBuildNodes", params).then(r => r.data)
// 消息节点新增  buildNode/addBuildNode
http.addBuildNode = params => axios.post("/api/buildNode/addBuildNode", params).then(r => r.data)
// 消息节点修改 buildNode/updBuildNode
http.updBuildNode = params => axios.post("/api/buildNode/updBuildNode", params).then(r => r.data)
// 消息节点的删除 buildNode/delBuildNode
http.delBuildNode = params => axios.post("/api/buildNode/delBuildNode", params).then(r => r.data)
// 消息信息的亮点数据  buildLightspot/getBuildLightspots
http.getBuildLightspots = params => axios.post("/api/buildLightspot/getBuildLightspots", params).then(r => r.data)
// 消息信息亮点添加
http.addBuildLightspot = params => axios.post("/api/buildLightspot/addBuildLightspot", params).then(r => r.data)
// 消息亮点的删除
http.delBuildLightspot = params => axios.post("/api/buildLightspot/delBuildLightspot", params).then(r => r.data)
// 项目平面图  buildMaterial/getBuildPlans
http.getBuildPlans = params => axios.post("/api/buildMaterial/getBuildPlans", params).then(r => r.data)
// 项目效果图  /buildMaterial/getBuildRenderings
http.getBuildRenderings = params => axios.post("/api/buildMaterial/getBuildRenderings", params).then(r => r.data)
// 监控大屏倒计时  buildInfo/getBuildDate
http.getBuildDate = params => axios.post("/api/buildInfo/getBuildDate", params).then(r => r.data)
// 控制台倒计时  /getBuildInfo/getBuildDates
http.getBuildDates = params => axios.post("/api/buildInfo/getBuildDates", params).then(r => r.data)
// 设备检测系统
http.sel = params => axios.post("/api/buildEquipment/sel", params).then(r => r.data)
// ===任务信息管理===
// 添加
http.addmessage  = params => axios.post("/api/buildMessage/in", params).then(r => r.data)
// 查询
http.inquire = params => axios.post("/api/buildMessage/sel", params).then(r => r.data)
// 删除
http.remove = params => axios.post("/api/buildMessage/del", params).then(r => r.data)
//====报警记录===
// 搜索设备
http.sougetBuild = params => axios.post("/api/buildEquipmentType/getBuildEquipmentTypes", params).then(r => r.data)

// 查询
http.demand = params => axios.post("/api/buildAlarminfo/sel", params).then(r => r.data)
//添加
http.addition = params => axios.post("/api/buildAlarminfo/in", params).then(r => r.data)
//删除
http.delline = params => axios.post("/api/buildAlarminfo/del", params).then(r => r.data)
// 修改
http.modification = params => axios.post("/api/buildAlarminfo/up", params).then(r => r.data)

// 车辆数据接口
http.getCarEquipmentNum  = params => axios.post("/api/buildConsole/getCarEquipmentNum", params).then(r => r.data)
// 塔吊设备数据接口
http.getTowerNum  = params => axios.post("/api/buildConsole/getTowerNum", params).then(r => r.data)
// 环境监测设备数据接口
http.getWeatherNum  = params => axios.post("/api/buildConsole/getWeatherNum", params).then(r => r.data)
// 环境监控设备数据接口
http.getMonitorNum  = params => axios.post("/api/buildConsole/getMonitorNum", params).then(r => r.data)
// 监控大屏安全作业统计图数据  buildLargeScreen/getBuildGroupNum
http.getBuildGroupNum = params => axios.post("/api/buildLargeScreen/getBuildGroupNum", params).then(r => r.data)
// 监控大屏的第三部分人员考勤数据
http.getBuildAttendanceNow = params => axios.post("/api/buildAttendance/getBuildAttendanceNow", params).then(r => r.data)
// 监控大屏的第三部分车辆数据
http.getBuildCarList = params => axios.post("/api/buildLargeScreen/getBuildCarList", params).then(r => r.data)
//监控大屏大图下面的预警监测
http.getAlarminfoNum = params => axios.post("/api/buildLargeScreen/getAlarminfoNum", params).then(r => r.data)
//监控大屏大图下面的工程进度
http.getNodeDates = params => axios.post("/api/buildNode/getNodeDates", params).then(r => r.data)
// 监控大屏的预警监测里的自动向上数据 buildLargeScreen/getAlarminfoNum
http.getAlarminfoNum = params => axios.post("/api/buildLargeScreen/getAlarminfoNum", params).then(r => r.data)
//监控大屏右面的表格
http.rightchart1 = params => axios.post("/api/suiji/huanjing", params).then(r => r.data)
//监控大屏--左侧环境监测
// //塔吊
http.tower = params => axios.post("/api/buildLargeScreen/getBuildTowerList", params).then(r => r.data)
//环境监测数值
http.ygetBuildWeatherList = params => axios.post("/api/buildLargeScreen/getBuildWeatherList", params).then(r => r.data)
// 环境监测下拉框
http.hujList= params => axios.post("/api/buildLargeScreen/getBuildWeatherNameList", params).then(r => r.data)
// 基坑下拉
http.jkList= params => axios.post("/api/buildLargeScreen/getBuildPitNameList", params).then(r => r.data)
//基坑数值
http.ygetBuildPitList= params => axios.post("/api/buildLargeScreen/getBuildPitList", params).then(r => r.data)
//监控大屏左面的表格班组统计
http.lgroupchart1= params => axios.post("/api/buildLargeScreen/getGroupTypeNumList", params).then(r => r.data)
//监控大屏监控大屏下的亮点
http.lliangdian= params => axios.post("/api/buildMaterial/getBuildLightspots", params).then(r => r.data)
// 个人中心的修改头像 buildPeople/updPeopleUrl
http.updPeopleUrl= params => axios.post("/api/buildPeople/updPeopleUrl", params).then(r => r.data)
http.lliangdian= params => axios.post("/api/buildLightspot/getBuildLightspot", params).then(r => r.data)

// 权限接口tiaozhuan/goit
http.goit= params => axios.post("/api/tiaozhuan/goit", params).then(r => r.data)
// 人员管理权限
http.qita= params => axios.post("/api/tiaozhuan/qita", params).then(r => r.data)
// 摄像头carShiBie//getcarShiBie
http.getcarShiBie= params => axios.post("/api/carShiBie/getcarShiBie", params).then(r => r.data)
export default http